
export type UserInfo = {
  uid: string;
  email: string;
  name?: string;
  avatar?: string;
  sex?: number;
  phone?: string;
  remark?: string;
  nick?: string;
  birthday?: number;
  motto?: string;
  role: UserRole;
};

export enum SexType {
  Woman = 0,
  Man = 1,
}

export enum UserRole {
  Root = 1,
  User = 2,
}

export type RegisterForm = {
  email: string,
  sex: SexType,
  password: string,
}

export type UpdatePasswordInfo = {
  oldPsw: string;
  newPsw: string;
  newPswTips: string;
  repeatPsw: string;
  repeatPswTips: string;
}

/** 需废弃 */
export type AuthorInfo = {
  name: string;
  url?: string;
  gethub?: string;
  getee?: string;
}

/** 用户类 */
export class UserModel {
  private _data = <UserInfo>{};

  public get data(): UserInfo {
    return this._data;
  }

  public setData(info: UserInfo): void {
    this._data = info;
  }

}